package de.IIIfeed.MoneyPlanner;

import java.sql.Timestamp;

import org.kroz.activerecord.ActiveRecordBase;

public class Item  extends ActiveRecordBase implements Comparable<Item>{
	
	//instance vars
	public long id;	
	public String title;
	public float amount;
	public int type;
	public Timestamp dateStart;
	public long repeatType;
	public int repeatDay;
	public int repeatMonth;
	public Timestamp repeatEnd;
		
	/**
	 * @param id
	 * @param title
	 * @param amount
	 * @param type
	 * @param date
	 * @param repeatType
	 * @param repeatDay
	 * @param repeatMonth
	 * @param repeatEnd
	 */
	public Item(long id, String title, float amount, int type, Timestamp date,
			long repeatType, int repeatDay, int repeatMonth, Timestamp repeatEnd) {
		super();
		this.id = id;
		this.title = title;
		this.amount = amount;
		this.type = type;
		this.dateStart = date;
		this.repeatType = repeatType;
		this.repeatDay = repeatDay;
		this.repeatMonth = repeatMonth;
		this.repeatEnd = repeatEnd;
	}
	
	//empty constructor for active record. wtf?
	public Item(){
		
	}
	
	@Override
	public int compareTo(Item another) {
		return this.dateStart.compareTo(another.dateStart);
	}
}
